<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:77:"/Users/qingyun/php/fruits/public/../application/home/view/commodity_order.tpl";i:1515073135;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>确认订单</title>
</head>
<body>
<link href="/static/common/css/common.css" rel="stylesheet" type="text/css" />
<link href="/static/common/css/style.css" rel="stylesheet" type="text/css" />
<script src="/static/common/js/jquery1.42.min.js" type="text/javascript"></script>
<script src="/static/common/js/common_js.js" type="text/javascript"></script>
<script src="/static/common/js/footer.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/static/con/css/style.css" />
<link rel="stylesheet" type="text/css" href="/static/con/css/shopping-mall-index.css" />
<script type="text/javascript" src="/static/con/js/jquery.js"></script>
<script src="/static/common/js/jquery.SuperSlide.2.1.1.js" type="text/javascript"></script>
<script type="text/javascript" src="/static/con/js/zhonglin.js"></script>
<script type="text/javascript" src="/static/con/js/zhongling2.js"></script>
<script type="text/javascript" src="/static/con/js/jquery.provincesCity.js"></script>
<script type="text/javascript" src="/static/con/js/provincesData.js"></script>
<script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--顶部样式-->
<div id="top">
    <div class="top">
        <div class="Collection"><em></em><a href="#">收藏我们</a></div>
        <div class="hd_top_manu clearfix">
            <ul class="clearfix">
                <?php if(session('?UserXinxi') == false): ?>
                <li class="hd_menu_tit zhuce" data-addclass="hd_menu_hover">欢迎光临本店！<a href="<?php echo url('home/Login/index'); ?>" class="red">[请登录]</a> 新用户<a href="<?php echo url('home/User/add'); ?>" class="red">[免费注册]</a></li>
                <?php else: ?><li class="hd_menu_tit zhuce" data-addclass="hd_menu_hover">欢迎光临本店！<a href="<?php echo url('home/User/userInfo'); ?>" class="red">个人信息</a><a href="<?php echo url('home/User/loginOut'); ?>" class="red">退出登录</a></li>
                <?php endif; ?>
                <li class="hd_menu_tit" data-addclass="hd_menu_hover"><a href="#">我的订单</a></li>
                <li class="hd_menu_tit hd_Shopping_Cart" data-addclass="hd_menu_hover">
                    <a href="#" class="hd_menu">购物车(<b>0</b>)</a>
                    <div class="hd_Shopping_list">
                        <i></i>
                        <ul>

                        </ul>
                        <div class="Shopping_style"><a href="#" class="Shopping">查看我的购物车</a></div>
                    </div>
                </li>
                </li>
            </ul>
        </div>
    </div>
</div>
<div id="header"  class="header">
    <div class="logo"><a href="#"><img src="/static/common/images/logo.png" /></a></div>
    <div class="Search">
        <p><input name="" type="text"  class="text"/><input name="" type="submit" value="搜索"  class="Search_btn"/></p>

    </div>

</div>
<!--导航栏样式-->
<div id="Menu">
    <div class="Menu_style">

        <!--菜单栏-->
        <div class="Navigation" id="Navigation">
            <ul class="Navigation_name">
                <li><a href="<?php echo url('home/index/index'); ?>">首页</a></li>
                <li><a href="<?php echo url('home/commodity/lists'); ?>">水果</a></li>
            </ul>
        </div>
        <script>$("#Navigation").slide({titCell:".Navigation_name li"});</script>
        <!--购物车-->
    </div>
</div>


<!--正文-->

<div class="payment-interface w1200">
    <div class="pay-info">
        <div class="info-tit">
            <h3>选择收货地址</h3>
        </div>
        <ul class="pay-dz">
            <?php foreach($siteInfo as $vo): ?>
            <li name="a" >
                <input type="hidden" name="" value="<?php echo $vo['id']; ?>">
                <h3><span class="sp1"><?php echo $vo['region']; ?></span>（<span class="sp3"><?php echo $vo['name']; ?></span> 收）</h3>
                <p><span class="sp1"><?php echo $vo['address']; ?></span><span class="sp2"><?php echo $vo['tel']; ?></span></p>
                <a title="修改" href="javascript:;"onclick="admin_permission_edit('收货地址修改','<?php echo url('home/user/siteEdit'); ?>?id=<?php echo $vo['id']; ?>','1','','600')" style="float: left">修改</a>
            </li>
            <?php endforeach; ?>

            <div style="clear:both;"></div>
        </ul>
        <P class="pay-xgdz">修改地址和使用新地址样式一样。</P>
        <button onclick="jump()" class="pay-xdz-btn">使用新地址</button>
    </div>
    <div class="pay-info">
        <div class="info-tit" style="border-bottom:0;">
            <h3>订单信息</h3>
        </div>
    </div>
    <div class="cart-con-info">


        <div class="info-mid">
            <?php if(is_array($coInfo) || $coInfo instanceof \think\Collection || $coInfo instanceof \think\Paginator): $i = 0; $__LIST__ = $coInfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                <input type="hidden" name="coid" value="<?php echo $vo['coid']; ?>">
            <div class="mid-tu f-l" style="width:70px">
                <a href="#"><img src="<?php echo $vo['image']; ?>" /></a>
            </div>
            <div class="mid-font f-l" style="margin-right:40px;">
                <a href="#">商品名称:<?php echo $vo['name']; ?><br />商品简介:<?php echo $vo['details']; ?></a>
            </div>
            <div class="mid-guige1 f-l" style="margin-right:40px;">
                <p>颜色：正常</p>
                <p>规格：一箱</p>
            </div>
            <div class=" f-l" >

                数量:<input name="num" type="text" disabled value="<?php echo $vo['num']; ?>" />

            </div>
            <p class="mid-yunfei f-l">邮费:¥ 0.00</p>
            <p class="mid-dj f-l">单价¥ <?php echo $vo['price']; ?></p>
            <p class="mid-je f-l">合计¥ <?php echo $vo['price'] * $vo['num']; ?></p>
            <div class="mid-chaozuo f-l">
                <select>
                    <option>送货上门</option>
                    <option>快递包邮</option>
                </select>
            </div>
            <div style="clear:both;"></div>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </div>
        <div class="info-heji">
            <p class="f-r">合计(含运费)：<span>¥<?php echo $sumAll; ?></span></p>

        </div>
        <div class="info-tijiao">
            <p class="p1">实付款：<span>¥<?php echo $sumAll; ?></span></p>
            <button  onclick="makeOrder()" class="btn">提交订单</button>
        </div>
    </div>
</div>


<script>
    function admin_permission_edit(title,url,id,w,h){
        layer_show(title,url,w,h);
    }
    function jump() {
        window.location.href = '<?php echo url('home/user/site'); ?>'
    }
    var coid = [];


//    $('li').click(function () {
//
//        var seid =$(this).children('input').val()
//
//        coid.push(seid)
//
//    })

    var num = [];
    function makeOrder() {

        coid['0']=$(".current").children('input').val()
        $("input[name='coid']").each(function(){
            coid.push($(this).val());
        });
        $("input[name='num']").each(function(){
            num.push($(this).val());
        });
        $.ajax({
            type:"post",
            url:"<?php echo url('home/commodity/makeOrder'); ?>",
            dataType: 'json',
            data:{coid:coid,num:num},
            success:function (data) {
                if(data.status == -1){
                    layer.msg(data.msg,{icon:2,time:1000});
                }else{
                    layer.msg(data.msg,{icon:1,time:1000});
                    window.location.href = "<?php echo url('home/pay/pay'); ?>";
                }
            }
        })
    }





</script>
</body>
</html>